home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 98 / Skunkware 98.iso / src / mail / pine3.96.tar.gz / pine3.96.tar / pine3.96 / imap / ANSI / c-client / nntpcdos.h < prev    next >
C/C++ Source or Header  |  1996-03-15  |  7KB  |  157 lines

  1. /*
  2.  * Program:    Network News Transfer Protocol (NNTP) client routines for DOS
  3.  *
  4.  * Author:    Mark Crispin
  5.  *        Networks and Distributed Computing
  6.  *        Computing & Communications
  7.  *        University of Washington
  8.  *        Administration Building, AG-44
  9.  *        Seattle, WA  98195
  10.  *        Internet: MRC@CAC.Washington.EDU
  11.  *
  12.  * Date:    25 January 1993
  13.  * Last Edited:    14 March 1996
  14.  *
  15.  * Copyright 1996 by the University of Washington
  16.  *
  17.  *  Permission to use, copy, modify, and distribute this software and its
  18.  * documentation for any purpose and without fee is hereby granted, provided
  19.  * that the above copyright notices appear in all copies and that both the
  20.  * above copyright notices and this permission notice appear in supporting
  21.  * documentation, and that the name of the University of Washington not be
  22.  * used in advertising or publicity pertaining to distribution of the software
  23.  * without specific, written prior permission.  This software is made
  24.  * available "as is", and
  25.  * THE UNIVERSITY OF WASHINGTON DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED,
  26.  * WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT LIMITATION ALL IMPLIED
  27.  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, AND IN
  28.  * NO EVENT SHALL THE UNIVERSITY OF WASHINGTON BE LIABLE FOR ANY SPECIAL,
  29.  * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
  30.  * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, TORT
  31.  * (INCLUDING NEGLIGENCE) OR STRICT LIABILITY, ARISING OUT OF OR IN
  32.  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  33.  *
  34.  */
  35.  
  36. /* Constants */
  37.  
  38. #define NNTPGOK (long) 211    /* NNTP group selection OK */
  39. #define NNTPGLIST (long) 215    /* NNTP group list being returned */
  40. #define NNTPARTICLE (long) 220    /* NNTP article text */
  41. #define NNTPHEAD (long) 221    /* NNTP header text */
  42. #define NNTPBODY (long) 222    /* NNTP body text */
  43.  
  44.  
  45. /* Command bits from nntp_getflags() */
  46.  
  47. #define fSEEN 1
  48. #define fDELETED 2
  49. #define fFLAGGED 4
  50. #define fANSWERED 8
  51.  
  52.  
  53. /* NNTP I/O stream local data */
  54.     
  55. typedef struct nntp_local {
  56.   SMTPSTREAM *nntpstream;    /* NNTP stream for I/O */
  57.   unsigned int dirty : 1;    /* disk copy of .newsrc needs updating */
  58.   int fd;            /* temporary file */
  59.   unsigned long hm;        /* header text message number */
  60.   char *ht;            /* header text */
  61.   unsigned long hs;        /* header size */
  62.   unsigned long tm;        /* text temporary file message number */
  63.   char *tf;            /* name of the text temporary file */
  64.   char *host;            /* local host name */
  65.   char *name;            /* local bboard name */
  66.   unsigned long *number;    /* news message numbers */
  67. } NNTPLOCAL;
  68.  
  69.  
  70. /* Drive-dependent data passed to init method */
  71.  
  72. typedef struct nntp_data {
  73.   int fd;            /* file data */
  74.   unsigned long pos;        /* initial position */
  75. } NNTPDATA;
  76.  
  77.  
  78. STRINGDRIVER nntp_string;
  79.  
  80. /* Convenient access to local data */
  81.  
  82. #define LOCAL ((NNTPLOCAL *) stream->local)
  83.  
  84. /* Function prototypes */
  85.  
  86. DRIVER *nntp_valid (char *name);
  87. void *nntp_parameters (long function,void *value);
  88. void nntp_find (MAILSTREAM *stream,char *pat);
  89. void nntp_find_bboards (MAILSTREAM *stream,char *pat);
  90. void nntp_find_all (MAILSTREAM *stream,char *pat);
  91. void nntp_find_all_bboards (MAILSTREAM *stream,char *pat);
  92. long nntp_subscribe (MAILSTREAM *stream,char *mailbox);
  93. long nntp_unsubscribe (MAILSTREAM *stream,char *mailbox);
  94. long nntp_subscribe_bboard (MAILSTREAM *stream,char *mailbox);
  95. long nntp_unsubscribe_bboard (MAILSTREAM *stream,char *mailbox);
  96. long nntp_create (MAILSTREAM *stream,char *mailbox);
  97. long nntp_delete (MAILSTREAM *stream,char *mailbox);
  98. long nntp_rename (MAILSTREAM *stream,char *old,char *new);
  99. MAILSTREAM *nntp_mopen (MAILSTREAM *stream);
  100. void nntp_close (MAILSTREAM *stream);
  101. void nntp_fetchfast (MAILSTREAM *stream,char *sequence);
  102. void nntp_fetchflags (MAILSTREAM *stream,char *sequence);
  103. void nntp_string_init (STRING *s,void *data,unsigned long size);
  104. char nntp_string_next (STRING *s);
  105. void nntp_string_setpos (STRING *s,unsigned long i);
  106. ENVELOPE *nntp_fetchstructure (MAILSTREAM *stream,long msgno,BODY **body);
  107. char *nntp_fetchheader (MAILSTREAM *stream,long msgno);
  108. char *nntp_fetchtext (MAILSTREAM *stream,long msgno);
  109. char *nntp_fetchbody (MAILSTREAM *stream,long m,char *s,unsigned long *len);
  110. char *nntp_fetchheader_work(MAILSTREAM *stream,long msgno,unsigned long *size);
  111. int nntp_fopen (char *file,int access,unsigned long *size);
  112. long nntp_read (MAILSTREAM *stream,unsigned long count,char *buffer);
  113. int nntp_fetchtext_work (MAILSTREAM *stream,long msgno,unsigned long *size);
  114. void nntp_setflag (MAILSTREAM *stream,char *sequence,char *flag);
  115. void nntp_clearflag (MAILSTREAM *stream,char *sequence,char *flag);
  116. void nntp_search (MAILSTREAM *stream,char *criteria);
  117. long nntp_ping (MAILSTREAM *stream);
  118. void nntp_check (MAILSTREAM *stream);
  119. void nntp_expunge (MAILSTREAM *stream);
  120. long nntp_copy (MAILSTREAM *stream,char *sequence,char *mailbox);
  121. long nntp_move (MAILSTREAM *stream,char *sequence,char *mailbox);
  122. long nntp_append (MAILSTREAM *stream,char *mailbox,char *flags,char *date,
  123.           STRING *message);
  124. void nntp_gc (MAILSTREAM *stream,long gcflags);
  125.  
  126. short nntp_getflags (MAILSTREAM *stream,char *flag);
  127. char nntp_search_all (MAILSTREAM *stream,long msgno,char *d,long n);
  128. char nntp_search_answered (MAILSTREAM *stream,long msgno,char *d,long n);
  129. char nntp_search_deleted (MAILSTREAM *stream,long msgno,char *d,long n);
  130. char nntp_search_flagged (MAILSTREAM *stream,long msgno,char *d,long n);
  131. char nntp_search_keyword (MAILSTREAM *stream,long msgno,char *d,long n);
  132. char nntp_search_new (MAILSTREAM *stream,long msgno,char *d,long n);
  133. char nntp_search_old (MAILSTREAM *stream,long msgno,char *d,long n);
  134. char nntp_search_recent (MAILSTREAM *stream,long msgno,char *d,long n);
  135. char nntp_search_seen (MAILSTREAM *stream,long msgno,char *d,long n);
  136. char nntp_search_unanswered (MAILSTREAM *stream,long msgno,char *d,long n);
  137. char nntp_search_undeleted (MAILSTREAM *stream,long msgno,char *d,long n);
  138. char nntp_search_unflagged (MAILSTREAM *stream,long msgno,char *d,long n);
  139. char nntp_search_unkeyword (MAILSTREAM *stream,long msgno,char *d,long n);
  140. char nntp_search_unseen (MAILSTREAM *stream,long msgno,char *d,long n);
  141. char nntp_search_before (MAILSTREAM *stream,long msgno,char *d,long n);
  142. char nntp_search_on (MAILSTREAM *stream,long msgno,char *d,long n);
  143. char nntp_search_since (MAILSTREAM *stream,long msgno,char *d,long n);
  144. unsigned long nntp_msgdate (MAILSTREAM *stream,long msgno);
  145. char nntp_search_body (MAILSTREAM *stream,long msgno,char *d,long n);
  146. char nntp_search_subject (MAILSTREAM *stream,long msgno,char *d,long n);
  147. char nntp_search_text (MAILSTREAM *stream,long msgno,char *d,long n);
  148. char nntp_search_bcc (MAILSTREAM *stream,long msgno,char *d,long n);
  149. char nntp_search_cc (MAILSTREAM *stream,long msgno,char *d,long n);
  150. char nntp_search_from (MAILSTREAM *stream,long msgno,char *d,long n);
  151. char nntp_search_to (MAILSTREAM *stream,long msgno,char *d,long n);
  152. typedef char (*search_t) (MAILSTREAM *stream,long msgno,char *d,long n);
  153.  
  154. search_t nntp_search_date (search_t f,long *n);
  155. search_t nntp_search_flag (search_t f,char **d);
  156. search_t nntp_search_string (search_t f,char **d,long *n);
  157.